home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / svgabg.exe / NOTES_S3.SVG < prev    next >
Text File  |  1992-06-25  |  3KB  |  67 lines

  1. SuperVGA S3 BGI driver 
  2. Version 1.0
  3. June 28, 1992
  4.  
  5. This is the first version of my SuperVGA S3 BGI driver.  All functions
  6. have been implemented, but there may still be bugs.
  7.  
  8. Note:  Palette functions, and the mouse cursor will not work with this driver.
  9.        Paging is not yet implemented
  10.  
  11.   Using the driver in the 256 and 16 color modes is similar to using the
  12.   standard SuperVGA 256 and 16 color drivers.  See the files NOTES[256|16].SVG
  13.  
  14.   Using the S3 driver in 32768 color mode:
  15.  
  16.     Implementing the 32768 color driver involved several hacks, as
  17.     the BGI interface only supports 8-bit color values, but the driver
  18.     needed support for 15-bit color values.  The procedures that needed
  19.     to be changed were those that accepted color values, (SetColor,
  20.     SetFillStyle, SetFillPattern, PutPixel and Floodfill)  and those 
  21.     that return color values (GetColor and GetPixel).
  22.     As the HiColor modes do not support palettes, I decided to use
  23.     the SetRgbPalette call to set colors, as it accepts values for the 
  24.     R,G and B components of the color.
  25.  
  26.     The format of a pixel in the HiColor modes is:
  27.         -Byte 1- -Byte 0-
  28.         xRRRRRGG GGGBBBBB
  29.  
  30.     Several new functions are defined to make the color selection easier.
  31.     In addition, the macro RGB(rv,gv,bv) has been defined.  It packs
  32.     the R, G and B values into the format described above and returns the
  33.     combined color.
  34.  
  35.     * RealDrawColor(); - Sets the current drawing color.
  36.       Usage:
  37.         setcolor(RealDrawColor(RGB(rval,gval,bval)); - HiColor modes
  38.         setcolor(RealDrawColor(cval)); - (suggested for any other driver)
  39.  
  40.     * RealFillColor(); - Sets the current fill color.
  41.       Usage:
  42.         setfillstyle(fillstyle,RealFillColor(RGB(rval,gval,bval)));
  43.         setfillstyle(fillstyle,RealFillColor(cval));
  44.         setfillpattern(fillpat,RealFillColor(RGB(rval,gval,bval)));
  45.         setfillpattern(fillpat,RealFillColor(cval));
  46.  
  47.     * RealColor(); - For putpixel, sets the color of the pixel
  48.                - For floodfill, sets the color of the boundary
  49.         putpixel(x,y,RealColor(RGB(rval,gval,bval)));
  50.         putpixel(x,y,RealColor(cval));
  51.         floodfill(x,y,RealColor(RGB(rval,gval,bval)));
  52.         floodfill(x,y,RealColor(cval));
  53.  
  54.     * GetPixel normally only returns an 8-bit value.  However, the
  55.       value returned from the BGI driver is a 16-bit value in DX (the 
  56.       BGI kernel loads the value into AX and clears the upper 8 bits),
  57.       so to read the value of a pixel:
  58.  
  59.       In Pascal:
  60.         Color := getpixel(x,y);
  61.         inline($89/$56/<Color);  (* Loads 15-bit color value *)
  62.  
  63.       In C:
  64.         Color = getpixel(x,y);
  65.         Color = _DX;
  66.       
  67.